package com.dongdongshop.service.impl;

import com.alibaba.dubbo.config.annotation.Reference;
import com.alibaba.dubbo.config.annotation.Service;
import com.dongdongshop.mapper.seller.TbItemCatMapper;
import com.dongdongshop.pojo.seller.TbItemCat;
import com.dongdongshop.pojo.seller.TbItemCatExample;
import com.dongdongshop.service.ItemCatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

@Service
@Component
public class ItemCatServiceImpl implements ItemCatService {

    @Resource
    private TbItemCatMapper itemCatMapper;
    @Override
    public List<TbItemCat> getInfoByPid(Long parentId) {
        return itemCatMapper.getInfoByPid(parentId);
    }

    @Override
    public void addInfo(TbItemCat itemCat) {
        itemCatMapper.insertSelective(itemCat);
    }

    @Override
    public int deleteInfo(Integer[] ids) {
        return itemCatMapper.deleteInfo(ids);
    }

    @Override
    public TbItemCat eachItemInfo(Long id) {
        return itemCatMapper.selectByPrimaryKey(id);
    }

    @Override
    public void updateItemInfo(TbItemCat itemCat) {
        itemCatMapper.updateByPrimaryKeySelective(itemCat);
    }

    @Override
    public TbItemCat getItemTypeId(Long id) {
        return itemCatMapper.selectByPrimaryKey(id);
    }


    @Override
    public TbItemCat findItemcategory1Id(Long id) {
        return itemCatMapper.selectByPrimaryKey(id);
    }

    @Override
    public TbItemCat findItemcategory2Id(Long id) {
        return itemCatMapper.selectByPrimaryKey(id);
    }

    @Override
    public TbItemCat findItemcategory3Id(Long id) {
        return itemCatMapper.selectByPrimaryKey(id);
    }
}
